<template>
    <div class="login_first">
      <div class="login_first_navbar">
        <div class="login_first_02"><!--logo-->
          <img src="../../assets/login/first/123005.png" style="width: 100px; height: 52px;">
        </div>
        <NavMenu></NavMenu>
         <div class="login_btn">
          <van-button type="primary" plain @click="getLogin" class="btn01">登录/注册</van-button>
        </div>
        <div class="login_people">
          <i class="el-icon-s-custom"></i>
        </div>
     </div>

      <div class="login_first_fixed">
        <a href="javaScript:0"><span class="login_first_fixed_s1" >建议反馈</span></a>
        <a href="javaScript:0"><span class="login_first_fixed_s2">采集清单</span></a>
          <i class="el-icon-upload2" @click="backTop"/>
      </div>

<!--      <div class="china">台湾永远是中国的一部分</div>
      <div class="city"><div class="dotted"></div><div class="pulse1">朔州</div><div class="pulse2"></div><div class="pulse3"></div></div>
      <div class="city"><div class="dotted"></div><div class="pulse1">朔州</div><div class="pulse2"></div><div class="pulse3"></div></div>
      <div class="city td"><div class="dotted"></div><div class="pulse1">北京</div><div class="pulse2"></div><div class="pulse3"></div></div>
      <div class="city td1"><div class="dotted"></div><div class="pulse1">台湾</div><div class="pulse2"></div><div class="pulse3"></div></div>-->

      <div class="login_first_image">
        <transition name="fade-login">
          <keep-alive include="Login">
            <Login v-if="showBack" ></Login>   <!--子船夫-->
          </keep-alive>
        </transition>
        <transition name="fade-login">
          <!--存放二维码-->
          <div v-if="!showBack">
            <WeiCode v-if="weiCode">
              <template #weiCode>
                <el-button size="small" type="primary" @click="closeCode">取消</el-button>
              </template>
            </WeiCode>

            <QQCode v-if="qqCode">
              <template #qqCode>
                <el-button size="small" type="primary" @click="closeCode">取消</el-button>
              </template>
            </QQCode>
            <APPCode v-if="appCode">
              <template #appCode>
                <el-button size="small" type="primary" @click="closeCode">取消</el-button>
              </template>
            </APPCode>
          </div>
        </transition>
      </div>

      <div class="login_first_swipe">
        <div class="login_first_swipe_item" v-for="(item, index) in image" :key="index">
          <a :href="item.url" ><img draggable="false" :src="item.img"/></a>
        </div>
      </div>

      <div class="login_first_list">
        <shopping-item v-for="(item, index) in shoppingList" :key="item.id"
                 :text="item.text"
                 :shopping1="item.shopping1"
                 :shopping2="item.shopping2"
        />
      </div>

    </div>
</template>

<script>
import { shoppingList } from "@/views/login/shopping";
import ShoppingItem from "@/views/login/ShoppingItem";
import Login from "@/components/login/Login.vue";
import WeiCode from "@/components/login/qrCode/WeiCode";
import QQCode from "@/components/login/qrCode/QQCode";
import APPCode from "@/components/login/qrCode/APPCode";
import {Message} from "element-ui";
import yi from '@/assets/images/一站购齐.png'
import fu from '@/assets/images/复工复产.png'
import ban from '@/assets/images/办公.png'
import fang from '@/assets/images/防疫专场.png'
import { animateYPage } from "@/assets/js/animate";
import List from "@/views/system/user/virtual/list";
export default {
  name: "LoginFirst",
  components: {List, Login,APPCode,QQCode,WeiCode,ShoppingItem},  // 对象
  data() {
    return {
      qrcode: '',
      image: [
        {img: yi, url: "@/views/redirect"},{img: fu, url: "javaScript:0"},{img: ban, url: "javaScript:0"}
      ],
      shoppingList,
    }
  },
  computed: {
    weiCode() {
      return this.$store.state.code.weiCode
    },
    qqCode() {
      return this.$store.state.code.qqCode
    },
    appCode() {
      return this.$store.state.code.appCode
    },
    showBack() {
      return this.$store.state.code.showBack;
    }
  },
  created() {

  },
  methods: {
    getLogin() {
      this.$store.dispatch('code/update_showBack',true)
      Message.info('如果您有账号可直接登录，没有请先注册');
    },
    closeCode() {
      this.$store.dispatch('code/update_weiCode',false)
      this.$store.dispatch('code/update_qqCode',false)
      this.$store.dispatch('code/update_appCode',false)
      this.$store.dispatch('code/update_showBack',true)
    },
    backTop() {
      animateYPage(window, 0)
    }
  }
}

</script>

<style lang="scss" scoped>
@import "@/assets/styles/index01.css";
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.fade-login-enter-active {
  transition: opacity 1s;
}
.fade-login-enter {
  opacity: 0;
}
.fade-login-leave-to {
  opacity: 0;
}

.login_first {
  width: 100%;
  background: rgba(242, 242, 242);
  .login_first_navbar {
    width: 100%;
    height: 60px;
    background: rgba(19, 23, 24);
    .login_first_02 {
      position: absolute;
      top: 4px;
      left: 50px;
    }
    .login_people {
      position: absolute;
      width: 50px;
      height: 50px;
      font-size: 45px;
      color: #42b983;
      top: 10px;
      right: 10px;
    }
    .login_btn {
      position: absolute;
      top: 10px;
      right: 80px;
    }
    .btn01 {
      background-color: transparent;
    }
  }
  .login_first_fixed {
    border-radius: 60px 10px 10px 60px;
    -moz-box-shadow: inset 0 0 10px red;
    -webkit-box-shadow: inset 0 0 10px red;
    box-shadow: inset 0 0 10px red;
    position: fixed;top: 400px;right: 10px;
    width: 80px;height: 220px;
    background:rgba(255, 255, 255) ;
    overflow: hidden;
    z-index: 10;
    .login_first_fixed_s1 ,.login_first_fixed_s2 {
      font-size: 15px;
      position: absolute;
      top: 140px;
      left: 10px;
    }
    .login_first_fixed_s1:hover ,.login_first_fixed_s2:hover {
      color: red;
    }
    .login_first_fixed_s2 {
      top: 80px;
    }
    .el-icon-upload2 {
      position: absolute;
      font-size: 30px;
      left: 45px;
      bottom:5px
    }
  }
  .login_first_image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 500px;
    background: url('../../assets/images/it2.jpg');
  }
  .login_first_swipe {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 10px 100px;
    border-radius: 100px;
    background-color:rgba(0,0,0,.2);
    overflow: hidden;
    .login_first_swipe_item {
      img {
        border-radius: 20px;
      }
      img:hover {
        -moz-box-shadow:0 0 20px #06c;
        -webkit-box-shadow:0 0 20px #06c;
        box-shadow:0 0 20px #06c;
      }
    }
  }
  .login_first_list {
    margin-bottom: 30px;
  }
}
</style>
